#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/11/27 21:47
# @Author  : 新猿异码
# @Site    : https://gitee.com/chshao/autotest
# @CSDN    : https://blog.csdn.net/m0_37576542?type=blog
# @File    : Test_001.py
# @Desc    : 模块功能描述
# @Software: PyCharm
import time
import autotest
from autotest import *


def find():
    return range(5)


class Test_A(BaseTestCase):

    def setup(self):
        stepper.setup("输入网址")

    @test(reruns=0, marker='smoke', datas=find)
    def test_02(self, data):
        print(f"TestA.say: {data}")
        time.sleep(0.5)

    @test(desc="登录功能测试", reruns=2, marker='test')
    def test_01(self):
        stepper.step("打开网页")
        print("TestA.run")
        time.sleep(2)
        Assert.AssertTrue(True)
        Log.info("TestA.run")

        stepper.step("输入用户名、密码")

        stepper.step("点击登录按钮")

        stepper.check_point("检查登录是否成功")

    def teardown(self):
        Log.info(f"shao test run ")
        stepper.teardown("退出登录")


if __name__ == '__main__':
    autotest.main(testcase="testcase/Test_001.py:Test_A:test_01")
